package factory;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JPAFactory {
	
	private static JPAFactory factory;
	private static EntityManagerFactory emf;
	
	private JPAFactory() {
		super();
	}
	
	public static JPAFactory getInstance() {
		if (factory == null) {
			factory = new JPAFactory();
		}
		
		return factory;
	}
	
	public EntityManagerFactory getJPAFactory() {
		if (emf == null) {
			emf = Persistence
				.createEntityManagerFactory(
					"rmiPU");
		}
		
		return emf;
	}

}
